import requests
import json
from jsonpath import jsonpath

headers = {
    'user-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
    'referer': 'https://save.sorftime.com/?browser=1&site=01&token=VnIxdzBDR0E5SmhlY21iRFF5NUYrQT09&nodeId=toys-and-games&v=1.1.6.3&topnode=dG95cy1hbmQtZ2FtZXM%3D&lang=zh-CN&drawer=false',
    'origin': 'https://save.sorftime.com',
    'accept': 'application/json, text/plain, */*' ,
    'authority': 'save.sorftime.com' ,
    'authorization': 'BasicAuth VnIxdzBDR0E5SmhlY21iRFF5NUYrQT09'
}

requset_data= {"ProductId":"",
               "screenProductIds":"",
               "Range":0,
               "Month":-3,
               "BrandRecord":-1,
               "BeginDate":"",
               "EndDate":"",
               "End":20,
               "PageRange":1,
               "PageSize":100,
               "BeginPageRange":"",
               "EndPageRange":"","VariantMonth":0,"NodeId":"toys-and-games","Site":"01","Topnode":"dG95cy1hbmQtZ2FtZXM=","SearchAsinStr":"","Browser":"1"}
r = requests.post('https://save.sorftime.com/api/FlowCircle/InitBrandCharts?site=01&nodeId=toys-and-games',json = requset_data,headers=headers)
# amazon_top = r.json()
# print (amazon_top)
amz_top = r.json()
# print (amz_top)
amz_select = jsonpath(amz_top, '$.Data..Data')
print (amz_select)